#ifndef __LCD_H__
#define __LCD_H__
#include "stm32f10x.h"
#define LCD_DIRECT 1
#if LCD_DIRECT==1
	#define  LCD_ROW_NUM    320
	#define  LCD_COL_NUM    240
#else
	#define  LCD_ROW_NUM    240
	#define  LCD_COL_NUM    320
#endif

typedef struct
{
	uint16_t Command;
	uint16_t Data;
}LCD_Typedef;
#define LCD_BASE (uint32_t)(0x6C000000|(0x800-2))//A10地址线做RS,实际总线产生地址相对写入地址左移一位0000 0100 0000 0000为0x400,写入地址应当是0x800,此时A10-RS线为1,写入0x800-2地址将产生0000 0011 1111 1111信号,此时A10-RS线为0
#define _LCD ((LCD_Typedef*)LCD_BASE)

#define LCD_Write_Command(a) _LCD->Command = (a)
#define LCD_Write_Data(a) _LCD->Data = (a)

#define LCD_Set(c) LCD_Fill(0,0,LCD_ROW_NUM,LCD_COL_NUM,c)
#define LCD_Clear() LCD_Set(0xFFFF)
#define LCD_RST BITBAND_REG(GPIOC->ODR,5)
#define LCD_BL BITBAND_REG(GPIOB->ODR,0)

void LCDx_Init(void);
void LCD_Reset(void);
void LCD_Fill(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint16_t Color);
void LCD_DrawPoint(uint16_t x1,uint16_t y1,uint16_t Color);
extern GPIO PA, PB, PC, PD, PE, PG;
#endif
